/* 
 * pow (x, n)
 */

#include "../func.h"

double power(double x, int n)
{
    if (0 == n)
        return 1;
    double v = power(x, n / 2);
    if (n % 2 == 0)
        return v * v;
    else
        return v * v * x;
}